package com.common.enums;

/**
 * Created with IntelliJ IDEA.
 * Description:用户评论信息
 * Author : wangyu
 * Date: 2018-03-02
 * Time: 18:10
 */
public enum MusicCommentEnum {
    CMT_USER("USER_CMT","评论_用户"),
    CMT_SONG("CMT_SONG","评论_歌曲"),
    CMT_SONG_MENU("XF","评论_歌单"),
    ;

    private final String code;
    private final String name;

    private MusicCommentEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }


    public String getCode() {
        return code;
    }


    public String getName() {
        return name;
    }


    public static MusicCommentEnum getEnumByCode(String code){
        for(MusicCommentEnum e:MusicCommentEnum.values()){
            if(e.getCode().equals(code)){
                return e;
            }
        }
        throw new IllegalArgumentException("MusicCommentEnum is not exist : " + code);
    }
}
